﻿<%
Function Admin_Menu(pid)
	'----------------------------内容管理菜单结束----------------------
	Dim sqlAuth, rsAuth, Temp, i, zt, sqlGetGroup, rsGetGroup, AdminPurview_Group
	If Code_CLng(Session_Get(Session_For&"AdminGroupID")) <> 0 Then
		sqlGetGroup = "select * from Admin_Group where GroupID=" & Code_CLng(Session_Get(Session_For&"AdminGroupID")) & " and status=1"
		Call Exe_Conn(rsGetGroup,sqlGetGroup,1)
		If rsGetGroup.BOF And rsGetGroup.EOF Then
			rsGetGroup.Close
			Set rsGetGroup = Nothing
			AdminPurview_Group = 0
		Else
			AdminPurview_Group = rsGetGroup("rules")
			If StrLen(AdminPurview_Group) = 0 Then AdminPurview_Group = 0
		End If
	End If
	If Code_CLng(Session_Get(Session_For&"AdminGroupID")) <> 0 Then
		admin_lever_where = " And AuthID In("&AdminPurview_Group&")"
	End If
	sqlAuth = "Select * From Admin_Auth Where menustatus=1 And pid="&pid&admin_lever_where&" Order By sort Asc,AuthID Asc"
	Call Exec(rsAuth,sqlAuth,2)
	Do While Not rsAuth.EOF
		If Code_CLng(Session_Get(Session_For&"AdminGroupID")) = 0 Or CheckPurview_Other(AdminPurview_Group, rsAuth("AuthID")) Then
			If rsAuth("zt")<>"" Then
				zt = rsAuth("zt")
			Else
				zt = "null"
			End If
			If Temp = "" Then
				Temp = Temp & "{""id"":" & rsAuth("AuthID") & ",""href"":""" & Replace(rsAuth("href"),"/","\/") & """,""title"":""" & ToUnicode(rsAuth("title")) & """,""type"":" & rsAuth("type") & ",""status"":" & rsAuth("status") & ",""authopen"":" & rsAuth("authopen") & ",""icon"":""" & rsAuth("icon") & """,""condition"":""" & rsAuth("condition") & """,""pid"":" & rsAuth("pid") & ",""sort"":" & rsAuth("sort") & ",""addtime"":""" & Time_Type(rsAuth("addtime"),1) & """,""zt"":" & zt & ",""menustatus"":" & rsAuth("menustatus") & ",""children"":["&Admin_Menu(rsAuth("AuthID"))&"]}"
			Else
				Temp = Temp & ",{""id"":" & rsAuth("AuthID") & ",""href"":""" & Replace(rsAuth("href"),"/","\/") & """,""title"":""" & ToUnicode(rsAuth("title")) & """,""type"":" & rsAuth("type") & ",""status"":" & rsAuth("status") & ",""authopen"":" & rsAuth("authopen") & ",""icon"":""" & rsAuth("icon") & """,""condition"":""" & rsAuth("condition") & """,""pid"":" & rsAuth("pid") & ",""sort"":" & rsAuth("sort") & ",""addtime"":""" & Time_Type(rsAuth("addtime"),1) & """,""zt"":" & zt & ",""menustatus"":" & rsAuth("menustatus") & ",""children"":["&Admin_Menu(rsAuth("AuthID"))&"]}"
			End If
		End If
		rsAuth.MoveNext
	Loop
	rsAuth.Close
	Set rsAuth = Nothing
	'----------------------------内容管理菜单结束----------------------
	Admin_Menu = Temp
End Function
%>